package br.com.application.activities;

import br.com.application.dao.DAOSQLite;
import br.com.application.dao.DAOStudent;
import android.app.Activity;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;

public class MainActivity extends Activity {

	private SQLiteDatabase banco;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		banco = openOrCreateDatabase(DAOSQLite.DBNAME, 0, null);
		if(new DAOStudent(banco).hasStudent()){
			Intent it = new Intent(getApplicationContext(), WelcomeActivity.class);
			this.finish();
			startActivity(it);
		}else{
			Intent it = new Intent(getApplicationContext(), RegisterActivity.class);
			this.finish();
			startActivity(it);
		}
		
	}

	
	
}
